home *** CD-ROM | disk | FTP | other *** search
- Superprimitives
- ===============
- All superprimitives take a "prefix" as their first argument.
- This allows the creation of a named object rather than an instance of the
- object. For example, "RSPsoapbar(name suds, RSSsoap_light())" creates a
- soap bar named "suds" that can be called later with "object suds". If the
- first argument is left empty, an instance is created. For example,
- "RSPsoapbar(,RSSsoap_light())" creates an instance of the soapbar.
- All superprimitives can be called as instances within aggregate objects
- including CSG objects (however, not all objects are "closed" -- see CSG
- below). All objects can be followed by transformation and texturing
- calls.
-
- CSG -- Several of the superprimitives are "closed" under CSG rules. The list
- of valid CSG objects can be found in Docs/CSG.
-
- The following superprimitives are defined:
-
- RSPboxframe(prefix,x1,y1,z1,x2,y2,z2,r) (rounded.rh)
- RSPchessboard(prefix,s1,s2,sc) (chess.rh)
- RSPcube(prefix,surf) (regsolids.rh)
- RSPcylinder_board(prefix,s1,s2,sc) (chess.rh)
- RSPdodecahedron(prefix,surf) (regsolids.rh)
- RSPfont_A(prefix,t) (font.rh)
- .
- .
- .
- RSPfont_Z(prefix,t) (font.rh)
- RSPfont_a(prefix,t) (font.rh)
- .
- .
- .
- RSPfont_z(prefix,t) (font.rh)
- RSPfont_0(prefix,t) (font.rh)
- .
- .
- .
- RSPfont_9(prefix,t) (font.rh)
- RSPfont_ampersand(prefix,t) (font.rh)
- RSPfont_apostrophe(prefix,t) (font.rh)
- RSPfont_asterisk(prefix,t) (font.rh)
- RSPfont_at(prefix,t) (font.rh)
- RSPfont_backapostrophe(prefix,t) (font.rh)
- RSPfont_backslash(prefix,t) (font.rh)
- RSPfont_carat(prefix,t) (font.rh)
- RSPfont_colon(prefix,t) (font.rh)
- RSPfont_comma(prefix,t) (font.rh)
- RSPfont_dollar(prefix,t) (font.rh)
- RSPfont_equals(prefix,t) (font.rh)
- RSPfont_exclamation(prefix,t) (font.rh)
- RSPfont_greater(prefix,t) (font.rh)
- RSPfont_left_brace(prefix,t) (font.rh)
- RSPfont_leftb(prefix,t) (font.rh)
- RSPfont_leftp(prefix,t) (font.rh)
- RSPfont_less(prefix,t) (font.rh)
- RSPfont_minus(prefix,t) (font.rh)
- RSPfont_percent(prefix,t) (font.rh)
- RSPfont_period(prefix,t) (font.rh)
- RSPfont_pipe(prefix,t) (font.rh)
- RSPfont_plus(prefix,t) (font.rh)
- RSPfont_pound(prefix,t) (font.rh)
- RSPfont_question(prefix,t) (font.rh)
- RSPfont_quotes(prefix,t) (font.rh)
- RSPfont_right_brace(prefix,t) (font.rh)
- RSPfont_rightb(prefix,t) (font.rh)
- RSPfont_rightp(prefix,t) (font.rh)
- RSPfont_semicolon(prefix,t) (font.rh)
- RSPfont_slash(prefix,t) (font.rh)
- RSPfont_tilde(prefix,t) (font.rh)
- RSPfont_underscore(prefix,t) (font.rh)
- RSPglass(prefix, surf) (clean.rh)
- RSPglass_holder(prefix, surf) (clean.rh)
- RSPgridobj(prefix,surf) (grid.rh)
- RSPicosahedron(prefix,surf) (regsolids.rh)
- RSPjewel8pt(prefix,surf) (jewels.rh)
- RSPmounted_jewel8pt(prefix,jewel_surf,bracket_surf) (jewels.rh)
- RSPoctahedron(prefix,surf) (regsolids.rh)
- RSPquadprism(prefix,surf,a,b,c,x,y,z) (prism.rh)
- RSProundedbox(prefix,x1,y1,z1,x2,y2,z2,r) (rounded.rh)
- RSProundedcylinder(prefix,r1,x1,y1,z1,x2,y2,z2,r2) (rounded.rh)
- RSProundeddisc(prefix,r,xp,yp,zp,xn,yn,zn,t) (rounded.rh)
- RSPskyplane(prefix) (sky.rh)
- RSPskysphere(prefix) (sky.rh)
- RSPsoap_and_dish(prefix, s_surf, d_surf) (clean.rh)
- RSPsoap_dish(prefix, surf) (clean.rh)
- RSPsoapbar(prefix, surf) (clean.rh)
- RSPtetrahedron(prefix,surf) (regsolids.rh)
- RSPtoothbrush(prefix, surf) (clean.rh)
- RSPtriprism(prefix,surf,x1,z1,x2,z2,x3,z3,y) (prism.rh)
-
-
- Descriptions
- ============
- The discriptions are sorted into the object files in which the
- superprimitive is defined. All examples are designed to work with the file
- "stdhdr" file which defines a default view and a unit coordinate axis to help
- with familiarization with the default placement, size and orientation of the
- various objects. To test them, append the example to the end of the stdhdr
- file and run rayshade with the path to the rsdefs package defined as in the
- main "Docs" file. Alternately, you could add the line '#include "stdhdr"'
- right before the example. The examples will also work with the line
- '#include "defs.rh"' before the example, but will lack the additions in the
- stdhdr file.
-
- ------ chess.rh ------
-
- RSPchessboard(prefix,s1,s2,sc)
- Creates a flat (i.e. zero "thickness") square chessboard with
- surfaces s1 and s2 with edges of length "sc" centered at the origin.
-
- /* Make a red and white chessboard 3 units on a side */
- RSPchessboard(,RSStest_red(),RSStest_white(),3)
-
- RSPcylinder_board(prefix,s1,s2,sc)
- Creates a fancy chessboard with cylinders in place of squares
- with surfaces s1 and s2 with edges of length "sc" and thickness of .01*sc
- with the top surface in the xy-plane centered at x = 0, y = 0.
-
- /* Make a fancy red and white chessboard 3 units on a side */
- RSPcylinder_board(,RSStest_red(),RSStest_white(),3)
-
- ------ clean.rh ------
-
- RSPtoothbrush(prefix, surf)
- Creates a toothbrush with surface "surf" and white bristles.
-
- /* Make a red plastic toothbrush */
- RSPtoothbrush(,RSSplastic())
- RSMscale(.2)
-
- RSPsoapbar(prefix, surf)
- Creates a textured "Irish Spring" soap bar with surface "surf".
-
- /* Make a green bar of soap */
- RSPsoapbar(,RSSsoap_light())
- RSMscale(.2)
-
- RSPsoap_dish(prefix, surf)
- Creates a soap dish with surface "surf".
-
- /* Make a pink soap dish */
- RSPsoap_dish(,RSSporcelain_pink())
- RSMscale(.2)
-
- RSPsoap_and_dish(prefix, s_surf, d_surf)
- Creates a bar of soap with surface "s_surf" in a soap dish with surface
- "d_surf".
-
- /* Make a pink soap dish with a green bar of soap */
- RSPsoap_and_dish(,RSSsoap_light(),RSSporcelain_pink())
- RSMscale(.2)
-
- RSPglass(prefix, surf)
- Creates a bumpy textured drinking glass with surface "surf".
-
- /* Make a red plastic glass */
- RSPglass(,RSSplastic())
- RSMscale(.5)
-
- RSPglass_holder(prefix, surf)
- Creates a glass holder with surface "surf". This has an indentation
- for a glass in the center and four holes for hanging toothbrushes at each
- corner.
-
- /* Make a pink glass holder */
- RSPglass_holder(,RSSporcelain_pink())
- RSMscale(.2)
-
- ------ font.rh ------
-
- RSPfont_A(prefix,t)
- .
- .
- .
- RSPfont_Z(prefix,t)
- RSPfont_a(prefix,t)
- .
- .
- .
- RSPfont_z(prefix,t)
- RSPfont_0(prefix,t)
- .
- .
- .
- RSPfont_9(prefix,t)
- RSPfont_ampersand(prefix,t)
- RSPfont_apostrophe(prefix,t)
- RSPfont_asterisk(prefix,t)
- RSPfont_at(prefix,t)
- RSPfont_backapostrophe(prefix,t)
- RSPfont_backslash(prefix,t)
- RSPfont_carat(prefix,t)
- RSPfont_colon(prefix,t)
- RSPfont_comma(prefix,t)
- RSPfont_dollar(prefix,t)
- RSPfont_equals(prefix,t)
- RSPfont_exclamation(prefix,t)
- RSPfont_greater(prefix,t)
- RSPfont_left_brace(prefix,t)
- RSPfont_leftb(prefix,t)
- RSPfont_leftp(prefix,t)
- RSPfont_less(prefix,t)
- RSPfont_minus(prefix,t)
- RSPfont_percent(prefix,t)
- RSPfont_period(prefix,t)
- RSPfont_pipe(prefix,t)
- RSPfont_plus(prefix,t)
- RSPfont_pound(prefix,t)
- RSPfont_question(prefix,t)
- RSPfont_quotes(prefix,t)
- RSPfont_right_brace(prefix,t)
- RSPfont_rightb(prefix,t)
- RSPfont_rightp(prefix,t)
- RSPfont_semicolon(prefix,t)
- RSPfont_slash(prefix,t)
- RSPfont_tilde(prefix,t)
- RSPfont_underscore(prefix,t)
- Creates "cylinderical" characters. The character is formed as if a
- sphere of radius "t" was swept along the lines and arcs that define the
- "base" character. The base character shapes are defined to be in the xz plane
- facing -y enclosed by the square 0,0 to 1,2 in the xz plane. The lowercase
- characters that have lower extensions extend down to z = -0.9.
-
- /* Make a red "A" with thickness of .1 */
- RSPfont_A(name char_A,.1)
- object RSStest_red() char_A
-
- ------ grid.rh ------
-
- RSPgridobj(prefix,surf)
- Creates an object with surface "surf" that is a grid of very
- thin cylinders (small enough to look like lines). It covers the cube
- measured from [0,0,0] to [10,10,10] breaking down the area into unit
- cubes. Useful for tests shots to judge distance and area.
-
- /* Grid the area from -2.0 to 2.0 in all directions */
- RSPgridobj(,RSStest_white())
- RSMscale(0.4)
- translate -2.0 -2.0 -2.0
-
- ------ jewels.rh ------
-
- RSPjewel8pt(prefix,surf)
- Creates an eight pointed jewel with surface "surf" with the base point
- at the origin and the front face at 0,-1,0.
-
- /* Make an emerald */
- RSPjewel8pt(,RSSemerald())
-
- RSPmounted_jewel8pt(prefix,jewel_surf,bracket_surf)
- Creates an eight pointed jewel with surface "jewel_surf" held by a
- bracket with surface "bracket_surf". The base point of the jewel is at the
- origin and the front face at 0,-1,0 (the bracket extends slightly beyond the
- base point -- i.e. the bracket extends slightly into the +y half-space).
-
- /* Make an emerald in a gold bracket */
- RSPmounted_jewel8pt(,RSSemerald(),RSSgold())
-
- ------ prisms.rh ------
-
- RSPquadprism(prefix,surf,a,b,c,x,y,z)
- Creates a box open on the y faces with given surface "surf".
- (a, b, c) and (x, y, z) are the diametrically opposed corners.
-
- /* Create an open unit box with corners at 0, 0, 0 and 1, 1, 1 */
- RSPquadprism(,RSStest_red(), 0, 0, 0, 1, 1, 1)
-
- RSPtriprism(prefix,surf,x1,z1,x2,z2,x3,z3,y)
- Creates a triagular prism of given surface "surf" along the y
- axis from y=0 to y="y". The trio of "x" and "z" pairs denote the
- triangle that sweeps out along the y axis to create the prism.
-
- /* Create a right triangle prism going from 0 to 5 in y */
- RSPtriprism(,RSStest_red(), 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 5.0)
-
- ------ regsolids.rh ------
-
- RSPtetrahedron(prefix,surf)
- RSPcube(prefix,surf)
- RSPoctahedron(prefix,surf)
- RSPdodecahedron(prefix,surf)
- RSPicosahedron(prefix,surf)
- Creates the given unit Platonic Solid with the surface "surf"
- centered at [0,0,0].
-
- /* Make a dodecahedron */
- RSPdodecahedron(,RSStest_white())
-
- ------ rounded.rh ------
-
- RSProundedbox(prefix,x1,y1,z1,x2,y2,z2,r)
- Creates a rounded box with faces at x1,y1,z1,x2,y2,z2 with rounded
- edges of radius "r". (This object is compleately enclosed by the box defined
- by x1,y1,z1 and x2,y2,z2.)
-
- /* Make a white box from -.5,-.5,-.25 to .5,.5,.25 with rounded edges of radius
- .1 */
- RSProundedbox(name rbox,-.5,-.5,-.25,.5,.5,.25,.1)
- object RSStest_white() rbox
-
- RSPboxframe(prefix,x1,y1,z1,x2,y2,z2,r)
- Creates a box frame for a box from x1,y1,z1 to x2,y2,z2 with cylinders
- of radius "r". (This object is compleately enclosed by the box defined by
- (x1-r),(y1-r),(z1-r) and (x2+r),(y2+r),(z2+r).)
-
- /* Make a white box frame from -1,-1,-1 to 1,1,1 with cylinders of r = .1 */
- applysurf RSStest_white()
- RSPboxframe(,-1,-1,-1,1,1,1,.1)
-
- RSProundedcylinder(prefix,r1,x1,y1,z1,x2,y2,z2,r2)
- Creates a cylinder from x1,y1,x2 to x2,y2,z2 of radius r1 with rounded
- edges of radius r2. (This object is compleately enclosed by the cylinder
- defined by radius r1 from x1,y1,z1 to x2,y2,z2.)
-
- /* Make a cylinder with surface RSSambulance of radius .5 with ends at
- -1,-2,-1 and 1,2,1 with rounded edges of radius .1 */
- applysurf RSSambulance()
- RSProundedcylinder(,.5,-1,-2,-1,1,2,1,.1)
-
- RSProundeddisc(prefix,r,xp,yp,zp,xn,yn,zn,t)
- Creates a "disc" of radius "r" centered at xp,yp,zp with a normal of
- xn,yn,zn with rounded edges of radius "t" and thinkness of "t". (This object
- is compleately enclosed by the cylinder defined by radius "r" and the points
- (xp,yp,zp)(+,-)(t/2 along the disc normal).)
-
- /* Make a rounded disk with surface RSSambulance of radius 1.5 centered
- at the origin with a normal of 2,-1,2 and a edge radius of .2 */
- applysurf RSSambulance()
- RSProundeddisc(,1.5,0,0,0,2,-1,2,.2)
-
- ------ sky.rh -----
-
- RSPskyplane(prefix)
- Creates a plane high up in z pointing downwards that has a
- sky-like texture on it. This works well for upward aimed shots.
-
- /* Create a flat sky */
- eyep -3 -30 -10
- RSMdaysky()
- light 1 1 1 point 500 -500 500
- RSPskyplane()
- scale .4 .3 1
-
- RSPskysphere(prefix)
- Creates a sphere centered at [0,0,0] of radius 9999.0 with a
- sky-like texture on it. This works well for distance or horizon aimed
- shots.
-
- /* Create a curved sky surrounding the origin */
- RSMdaysky()
- light 1 1 1 point 500 -500 500
- RSPskysphere()
-
-
-
-
- RSPfont_A(prefix,t) (font.rh)
- RSPfont_B(prefix,t) (font.rh)
- RSPfont_C(prefix,t) (font.rh)
- RSPfont_D(prefix,t) (font.rh)
- RSPfont_E(prefix,t) (font.rh)
- RSPfont_F(prefix,t) (font.rh)
- RSPfont_G(prefix,t) (font.rh)
- RSPfont_H(prefix,t) (font.rh)
- RSPfont_I(prefix,t) (font.rh)
- RSPfont_J(prefix,t) (font.rh)
- RSPfont_K(prefix,t) (font.rh)
- RSPfont_L(prefix,t) (font.rh)
- RSPfont_M(prefix,t) (font.rh)
- RSPfont_N(prefix,t) (font.rh)
- RSPfont_O(prefix,t) (font.rh)
- RSPfont_P(prefix,t) (font.rh)
- RSPfont_Q(prefix,t) (font.rh)
- RSPfont_R(prefix,t) (font.rh)
- RSPfont_S(prefix,t) (font.rh)
- RSPfont_T(prefix,t) (font.rh)
- RSPfont_U(prefix,t) (font.rh)
- RSPfont_V(prefix,t) (font.rh)
- RSPfont_W(prefix,t) (font.rh)
- RSPfont_X(prefix,t) (font.rh)
- RSPfont_Y(prefix,t) (font.rh)
- RSPfont_Z(prefix,t) (font.rh)
- RSPfont_a(prefix,t) (font.rh)
- RSPfont_b(prefix,t) (font.rh)
- RSPfont_c(prefix,t) (font.rh)
- RSPfont_d(prefix,t) (font.rh)
- RSPfont_e(prefix,t) (font.rh)
- RSPfont_f(prefix,t) (font.rh)
- RSPfont_g(prefix,t) (font.rh)
- RSPfont_h(prefix,t) (font.rh)
- RSPfont_i(prefix,t) (font.rh)
- RSPfont_j(prefix,t) (font.rh)
- RSPfont_k(prefix,t) (font.rh)
- RSPfont_l(prefix,t) (font.rh)
- RSPfont_m(prefix,t) (font.rh)
- RSPfont_n(prefix,t) (font.rh)
- RSPfont_o(prefix,t) (font.rh)
- RSPfont_p(prefix,t) (font.rh)
- RSPfont_q(prefix,t) (font.rh)
- RSPfont_r(prefix,t) (font.rh)
- RSPfont_s(prefix,t) (font.rh)
- RSPfont_t(prefix,t) (font.rh)
- RSPfont_u(prefix,t) (font.rh)
- RSPfont_v(prefix,t) (font.rh)
- RSPfont_w(prefix,t) (font.rh)
- RSPfont_x(prefix,t) (font.rh)
- RSPfont_y(prefix,t) (font.rh)
- RSPfont_z(prefix,t) (font.rh)
- RSPfont_0(prefix,t) (font.rh)
- RSPfont_1(prefix,t) (font.rh)
- RSPfont_2(prefix,t) (font.rh)
- RSPfont_3(prefix,t) (font.rh)
- RSPfont_4(prefix,t) (font.rh)
- RSPfont_5(prefix,t) (font.rh)
- RSPfont_6(prefix,t) (font.rh)
- RSPfont_7(prefix,t) (font.rh)
- RSPfont_8(prefix,t) (font.rh)
- RSPfont_9(prefix,t) (font.rh)
- RSPfont_backapostrophe(prefix,t) (font.rh)
- RSPfont_minus(prefix,t) (font.rh)
- RSPfont_equals(prefix,t) (font.rh)
- RSPfont_leftb(prefix,t) (font.rh)
- RSPfont_rightb(prefix,t) (font.rh)
- RSPfont_backslash(prefix,t) (font.rh)
- RSPfont_semicolon(prefix,t) (font.rh)
- RSPfont_apostrophe(prefix,t) (font.rh)
- RSPfont_comma(prefix,t) (font.rh)
- RSPfont_period(prefix,t) (font.rh)
- RSPfont_slash(prefix,t) (font.rh)
- RSPfont_tilde(prefix,t) (font.rh)
- RSPfont_exclamation(prefix,t) (font.rh)
- RSPfont_at(prefix,t) (font.rh)
- RSPfont_pound(prefix,t) (font.rh)
- RSPfont_dollar(prefix,t) (font.rh)
- RSPfont_percent(prefix,t) (font.rh)
- RSPfont_carat(prefix,t) (font.rh)
- RSPfont_ampersand(prefix,t) (font.rh)
- RSPfont_asterisk(prefix,t) (font.rh)
- RSPfont_leftp(prefix,t) (font.rh)
- RSPfont_rightp(prefix,t) (font.rh)
- RSPfont_underscore(prefix,t) (font.rh)
- RSPfont_plus(prefix,t) (font.rh)
- RSPfont_left_brace(prefix,t) (font.rh)
- RSPfont_right_brace(prefix,t) (font.rh)
- RSPfont_pipe(prefix,t) (font.rh)
- RSPfont_colon(prefix,t) (font.rh)
- RSPfont_quotes(prefix,t) (font.rh)
- RSPfont_less(prefix,t) (font.rh)
- RSPfont_greater(prefix,t) (font.rh)
- RSPfont_question(prefix,t) (font.rh)
-